#include <stdio.h>
#include <unistd.h>

int main()
{
	printf("begining...\n");
	pid_t id = fork();
	if(id == 0) //child
	{
		while(1)
		{
			printf("I am child process... PID:%d, PPID:%d\n", getpid(), getppid());
			sleep(1);
		}
	}
	else if(id > 0) //parent
	{
		while(1)
		{
			printf("I am parent process... PID:%d, PPID:%d\n", getpid(), getppid());
			sleep(1);
		}
	}
	else //error
	{}
	return 0;
}

/*int main()
{
	printf("begining...\n");
	pid_t id = fork();
	while(1)
	{	
		printf("I am process...PID: %d, PPID: %d\n", getpid(), getppid());
		sleep(1);
	}

	return 0;
}*/
